import rospy
from sensor_msgs.msg import PointCloud2


def point_cloud_callback(msg):
    num_points = msg.width * msg.height
    rospy.loginfo("Received point cloud with %d points", num_points)


if __name__ == '__main__':
    rospy.init_node('point_cloud_subscriber')
    rospy.Subscriber('/point_cloud_topic', PointCloud2, point_cloud_callback, queue_size=1)
    rospy.spin()
